<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>预览许可证书</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
			.titleCss{
				font-size:200%;
				text-align:center;
				font-weight: bold;
			}
			.titile1Css{
				font-size:350%;
				text-align:center;
				font-weight: bold;
			}
			.justifyCss{
				width:20%;
				text-align:justify;
				text-justify:distribute-all-lines;
				text-align-last:justify;
			}
			.tdCss{
				font-size:130%;
				font-weight: bold;
			}
			.tdcontentCss{
				font-size:200%;
				font-weight: bold;
			}
			.inputNoborder {
			    FONT-SIZE: 25px;
			    FONT-FAMILY: 宋体;
			    BORDER-RIGHT: #FFFFFF 1px solid;
			    BORDER-TOP: #FFFFFF 1px solid;
			    BORDER-LEFT: #FFFFFF 1px solid;
			    BORDER-BOTTOM: #FFFFFF 1px solid;
			}
				.inputNoborder2 {
			    FONT-SIZE: 18px;
			    FONT-FAMILY: 宋体;
			    BORDER-RIGHT: #FFFFFF 1px solid;
			    BORDER-TOP: #FFFFFF 1px solid;
			    BORDER-LEFT: #FFFFFF 1px solid;
			    BORDER-BOTTOM: #FFFFFF 1px solid;
			}
		</style>
		
		<script type='text/javascript' src="${ctx}/dwr/engine.js"></script>
		<script type='text/javascript' src="${ctx}/dwr/util.js"></script>
		<script type='text/javascript' src="${ctx}/dwr/interface/FileUploadCntl.js"></script>
		<script src="${ctx}/gzcgwsp/resources/js/YwUtil.js" type="text/javascript"></script>
		<script src="${ctx}/gzcgwsp/resources/js/YwEnterprise.js" type="text/javascript"></script>
		<script src="${ctx}/resources/js/jquery/jquery.js" type="text/javascript"></script>
		<script src="${ctx}/gzcgwsp/shljcz/js/csshljcz.js" type="text/javascript"></script>
		<script src="${ctx}/gzcgwsp/resources/js/YwUtil.js" type="text/javascript"></script>
		<script src="${ctx}/resources/components/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
		<script type="text/javascript">
			window.onload=function(){
				var activityName=document.getElementById("activityName").value;
				//只有最后一个环节"电子盖章"才可以打印,其他环节只可以保存
				if(activityName.indexOf("czdjgz")>=0){
					document.getElementById("printButton").style.display="";
					document.getElementById("saveButton").style.display="none";
				}else{
					//document.getElementById("printButton").style.display="none";
					document.getElementById("saveButton").style.display="";
				}
			}
			              //查看盖章
		 function viewgzJyxkzs(){
		 	   var filename = document.getElementById("sqdw").value+
		          document.getElementById("acceptNo").value+"许可证.doc";
		       var params="filename="+filename;   
		       var id=document.getElementById("id").value;
		       var templateCode='${templateCode}';
		       var url="${ctx}/yw-com-print!veiwGzfile.action?ywId="+id+"&templateCode="+templateCode;
		 	   $.ajax({
					url : url,
					type : "post",
					dataType : "html",
					data : params,
					success : function(msg) {
						   if(msg!=""){
					        	filename=filename.substring(0,filename.lastIndexOf("."));
								filename+=".ceb";
								filename=encodeURI(encodeURI(filename));
								window.location.href = "${ctx}/common/downloadfile.jsp?filepath="+msg+"&filename="+filename;  
							}else{
								alert('文件不存在！');
							}
					},
					error:function() {
						alert("添加失败！请刷新重试！");
					}
				});
		 	   
		 }
			//盖章许可证
			function gzxkz(){
           		var url = '${ctx}/dllszy!gzDoc.action?id=${id}&templateCode=${templateCode}&fileCode=xkz&taskInstDbid=${taskInstDbid}&templateId=621';
	       		window.open(url);
           
           }
	       function printXkz(){
	       		var url = '${ctx}/dllszy!printcz.action?id=${id}&templateCode=${templateCode}&fileCode=xkz&taskInstDbid=${taskInstDbid}&templateId=561';
	       		window.open(url);
           }
			function save(){
					var params = $("#xkzsForm").serialize();
					var url="${ctx}/dllszy!saveXkzs.action";
					$.ajax({
						url : url,
						type : "post",
						dataType : "html",
						data : params,
						success : function(msg) {
							if(msg=="true"){
								alert('保存成功!');
									
							}else{
								alert('保存失败！');
							}
							
						},
						error:function() {
							alert("添加失败！请刷新重试！");
						}
					});
			
			
			}

</script>
	</head>
	<body>
		<form action="" method="POST" id="xkzsForm">
		<input type="hidden" name="id" value="${id}"/>
		<input type="hidden" id="activityName" value="${hjmc}"/>
		<input type="hidden" id="templateCode" value="${templateCode}"/>
		<input type="hidden" id="taskInstDbid" value="${taskInstDbid}"/>
		<input type="hidden" id="sqdw" name="sqdw" value="${sqdw}"/>
		<input type="hidden" name="curYear" id="curYear" value="${curYear}"/>
		<input type="hidden" id="acceptNo" name="acceptNo" value="${acceptNo}"/>
			<table width="100%" height="80%" border="0" align="center">
				<tr>
					<td width="40%">
						<table align="center">
							<tr>
								<td>
									<br><br><br>
									<h1 style="font-size:52px" align="center" >
										城市道路人行道<br>及相关公共场地<br>临时占用<br>
										<span style="font-size:68px">许&nbsp;&nbsp;&nbsp;可&nbsp;&nbsp;&nbsp;证</span>
									</h1><br><br><br><br><br><br><br>
								</td>
							</tr>
							<tr>
								<td>
									<h3 align="right">
										编号：
										<u>
										<td bordercolor="#000000" colspan="2" height="150" align="center"><input name="zsbh" value="${zsbh }" style="  "/></td>
										</u>
									</h3>
								</td>
							</tr>
							<tr>
								<td>
									<h3 align="left">
										批准临占期限：
										<u>
											<input style="border:0;border-bottom:1 solid black;width:110px;" type="text" name="zysjqssj" readOnly="true" value="<s:date name='zysjqssj' format='yyyy年MM月dd日'/>" onfocus="WdatePicker({dateFmt:'yyyy年MM月dd日'})" class="textdocWdate" required="true"/>
											&nbsp;至
											<input style="border:0;border-bottom:1 solid black;width:110px;" type="text" name="zysjjssj" readOnly="true" value="<s:date name='zysjjssj' format='yyyy年MM月dd日'/>" onfocus="WdatePicker({dateFmt:'yyyy年MM月dd日'})" class="textdocWdate" required="true"/>
										</u>
									</h3>
								</td>
							</tr>
						</table>					
					</td>
					<td width="40%">
						<table width="100%" border="1" cellspacing="0" cellpadding="2" class="tpl_list_ui">
							<tr height="50px">
								<td colspan="2">临时占用单位：${zydw }</td>
							</tr>
							<tr height="50px">
								<td>负责人：<input name="aqfzr" value="${aqfzr}" style="border:0;"/></td>
								<td>电话：<input name="zydwTel" value="${zydwTel}" style="border:0;"/></td>
							</tr>
							<tr height="50px">
								<td colspan="2">临时占用地点：<input name="zylmld" value="${zylmld}" style="border:0;width:70%"/></td>
							</tr>
							<tr height="50px">
								<td colspan="2">临时占用性质：<input name="zyxz" value="${zyxz}" style="border:0;width:70%"/></td>
							</tr>
							<tr height="50px">
								<td colspan="2">临时占用面积：<textarea name="lszyArea" rows="8" style="border:0; width:100%">${lszyArea}</textarea></td>
							</tr>
							<tr height="50px">
								<td>投诉电话：12319</td>
								<td>发证时间：<input style="border:0;border-bottom:1 solid black;width:110px;" type="text" name="zsrq" readOnly="true" value="<s:date name='zsrq' format='yyyy年MM月dd日'/>" onfocus="WdatePicker({dateFmt:'yyyy年MM月dd日'})" class="textdocWdate" required="true"/></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
			<table align="center">
				<tr>
					<td>
						<input type="button" id="saveButton" onclick="save();" value="保&nbsp;&nbsp;存" style="width:100px;"/> 
					    <input type="button" onclick="printXkz();"  id="printButton" value="打&nbsp;&nbsp;印" style="width:100px;"/>
					      <input type="button" onclick="gzxkz();"  id="gzdoc" value="盖&nbsp;&nbsp;章" style="width:100px;"/>
					    <input type="button" onclick="viewgzJyxkzs();"  id="viewgzfile" value="查看盖章" style="width:100px;"/>
					    
					    <input type="button" onclick="window.close();"  id="printzs" value="关&nbsp;&nbsp;闭" style="width:100px;"/>
					</td>
				</tr>
		    </table>
		</form>
	
	</body>
</html>